package edu.unh.sustain;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;

public class IOLConnectorActivity extends Activity {
	
	String timeframe;
	Context ct = this;
	int tabNum = 2;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);

    	setContentView(R.layout.iolconnector);
    	
    	String[] stops = getResources().getStringArray(R.array.iolstops);
    	String[] stop1 = getResources().getStringArray(R.array.iolstop1);
    	String[] req = getResources().getStringArray(R.array.iolreq);
    	String[] stop2 = getResources().getStringArray(R.array.iolstop2);
    	TableLayout tbl = (TableLayout)findViewById(R.id.table1);
    	
    	for(int i = 0; i < stops.length; i++)
    	{
    		tbl.setColumnStretchable( i, true );
    		TableRow tr = new TableRow(tbl.getContext());
    		TextView tv = new TextView(this);
    		tv.setTextSize( 12 );
    		tv.setText(stops[i]);
    		tr.addView(tv);
	    	
	    	if(stop1[i].equals(""))
	    	{
	    		TextView tv2 = new TextView(this);
	    		tv2.setTextSize( 12 );
	    		tv2.setText(req[i]);
	    		TableRow.LayoutParams params = new TableRow.LayoutParams();
	    		params.span = 2;
	    		tv2.setLayoutParams(params);
	    		tr.addView(tv2);
	    	}
	    	else
	    	{
	    		TextView tv2 = new TextView(this);
	    		tv2.setTextSize( 12 );
	    		tv2.setText(stop1[i]);
	    		tv2.setWidth(100);
	    		tr.addView(tv2);
	    		
	    		TextView tv3 = new TextView(this);
	    		tv3.setTextSize( 12 );
	    		tv3.setText(stop2[i]);
	    		tv3.setWidth(100);
	    		tr.addView(tv3);
	    	}

    		tbl.addView(tr);
    	}
	}
}